<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>get</title>
</head>

<body>
  <script>
    let xhr = new XMLHttpRequest();
    xhr.onreadystatechange = () => {
        console.log('onreadystatechange', xhr.readyState);
      } 
    xhr.open("POST", "http://localhost:8082/post");
    xhr.responseType = "text"; 
    xhr.setRequestHeader('Content-Type', 'application/json');
    xhr.onload = () => {
      console.log('readyState', xhr.readyState);
      console.log('status', xhr.status);
      console.log('statusText', xhr.statusText);
      console.log('getAllResponseHeaders', xhr.getAllResponseHeaders());
      console.log('response', xhr.response);
    };
    var name='' 
    for(var i=0;i<10000;i++){
      name+='getAllResponseHeaders';
    }
    xhr.send(JSON.stringify({
      name,
      age: 10
    }));
  </script>
</body>

</html>